//
//  ZDReceiverCell.m
//  ZDPension
//
//  Created by 刘甲奇 on 2017/6/20.
//  Copyright © 2017年 maker. All rights reserved.
//

#import "ZDReceiverCell.h"

@interface ZDReceiverCell()

@property (weak, nonatomic) IBOutlet UIView *bgView;
@property (weak, nonatomic) IBOutlet UILabel *noAddressLabel;
@property (weak, nonatomic) IBOutlet UIView *addressBgView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *phoneLabel;
@property (weak, nonatomic) IBOutlet UILabel *addressLabel;
@property (weak, nonatomic) IBOutlet UIButton *changeButton;

/**
 <#Description#>
 */
@property(nonatomic, strong) changeClickBlock block;
@end

@implementation ZDReceiverCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.bgView.layer.borderWidth = 1;
    self.bgView.layer.borderColor = LEHaxColor(0xe8e8e8).CGColor;
    self.changeButton.layer.borderWidth = 1;
    self.changeButton.layer.borderColor = LEHaxColor(0xe8e8e8).CGColor;
}
- (void)addressChangeClick:(changeClickBlock)block
{
    _block = block;
}
- (void)setModel:(ZDAddressModel *)model
{
    if (model.noData)
    {
        self.noAddressLabel.hidden = NO;
        [self bringSubviewToFront:self.noAddressLabel];
        self.addressBgView.hidden = YES;
    }else
    {
        self.addressBgView.hidden = NO;
        self.noAddressLabel.hidden = YES;
        self.nameLabel.text = model.true_name;
        self.phoneLabel.text = model.tel_phone;
        self.addressLabel.text = [NSString stringWithFormat:@"%@%@",model.area_info,model.address];
    }

}
- (void)setNoAddress:(BOOL)noAddress
{

}
- (IBAction)changeClick:(UIButton *)sender
{
    _block(sender.tag);
}

@end
